﻿using sys = System;
using c = System.Console;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SplitOS.Utils
{
    public static class SplitOSConsole
    {
        public static void Write(string __value, sys.ConsoleColor __cc)
        {
            sys.ConsoleColor cc = c.ForegroundColor;
            c.ForegroundColor = __cc;
            c.Write(__value);
            c.ForegroundColor = cc;
        }
        public static void WriteLine(string __value, sys.ConsoleColor __cc)
        {
            sys.ConsoleColor cc = c.ForegroundColor;
            c.ForegroundColor = __cc;
            c.WriteLine(__value);
            c.ForegroundColor = cc;
        }
    }
    public static class Memory
    {
        public static uint GetMemory() { return Cosmos.Core.CPU.GetAmountOfRAM() + 2; }
    }
    public static class Language
    {
        public enum Languages { English, German }
        public static Languages lang { get; set; }
        public static void setLanguage(Languages __lang) { lang = __lang; }
    }
    public static class Out
    {
        public enum PromptTypes { Standard, Echo, Info, Warning, Error }
        public static PromptTypes prompt { get; set; }
        public static void WritePrompt()
        {
            switch (prompt)
            {
                case PromptTypes.Standard:
                    SplitOSConsole.Write("SplitOS> ", sys.ConsoleColor.White); break;
                case PromptTypes.Warning:
                    SplitOSConsole.Write("SplitOS> ", sys.ConsoleColor.Yellow); break;
                case PromptTypes.Error:
                    SplitOSConsole.Write("SplitOS> ", sys.ConsoleColor.Red); break;
                case PromptTypes.Echo:
                    SplitOSConsole.Write("User   > ", sys.ConsoleColor.Gray); break;
                case PromptTypes.Info:
                    SplitOSConsole.Write("Info   > ", sys.ConsoleColor.Green); break;
            }
        }
        public static void SwitchPrompt(PromptTypes __prompt = PromptTypes.Standard) { prompt = __prompt; }
        public static void WriteError(string __excpt)
        {
            PromptTypes oldprompt = prompt;
            SwitchPrompt(PromptTypes.Error);
            c.WriteLine(__excpt);
            SwitchPrompt(oldprompt);
        }
        public static void WriteInformation(string __info)
        {
            PromptTypes oldprompt = prompt;
            SwitchPrompt(PromptTypes.Info);
            c.WriteLine(__info);
            SwitchPrompt(oldprompt);
        }
    }
}